<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./demo01.css">
    <script src="./jquery-3.6.0.js"></script>
</head>
    <style>
        .high{
            background-color: lightblue;
            color: #333;
        }
    </style>
<body>
    <table border="1" cellspacing='0'>
        <thead>
            <tr>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th>家庭住址</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>张三</td>
                <td>男</td>
                <td>24</td>
                <td>福建省龙岩市新罗区</td>
            </tr>
            <tr>
                <td>李四</td>
                <td>女</td>
                <td>19</td>
                <td>江苏省扬州市</td>
            </tr>
            <tr>
                <td>王五</td>
                <td>18</td>
                <td>男</td>
                <td>山西省太原市</td>
            </tr>
            <tr>
                <td>小明</td>
                <td>21</td>
                <td>女</td>
                <td>河北省保定市</td>
            </tr>
        </tbody>
    </table>
    <script>
        $(function () {
            var a = $('tbody tr:even').css('background-color', 'lightblue')
            console.log(a);
            $('thead').css('background-color', 'lightpink')
            $('tbody tr').mouseover(function(){
                $(this).addClass('high').siblings().removeClass('high')
            })
        })
    </script>
</body>

</html>